package com.example.springboot.controller;

import com.example.springboot.entity.User;
import com.example.springboot.sernice.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 功能：提供接口返回数据
 * 作者：哈力娜
 * 日期：2024/6/20 20:38
 */
@RestController
public class Webcontroller {
    @RequestMapping
    public String hello(){
        return "hello";
    }

    @Autowired
    private UserService userService;

    @GetMapping("/list")
    public List<User> list(){
        return userService.list();
    }
}
